package unicall.em.repositories;


import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import unicall.em.models.Media;

public interface MediaRepository extends JpaRepository<Media, String>,PagingAndSortingRepository<Media, String>,JpaSpecificationExecutor<Media> {
   
    public Media findById(String id);
    
    @Query("from Media a where a.status=:status")
    public List<Media> queryAll(@Param("status")String status);
    
    @Query("from Media a")
    public Page<Media> queryAll(Specification<Media> specification,Pageable pageable);
    
}
